package br.edu.unirn.dao;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class Database {

	private static EntityManager em;

	private Database() {
	}

	public static EntityManager getInstance() {
		if(em == null){
			EntityManagerFactory emf = Persistence.createEntityManagerFactory("ConexaoDB");
			em = emf.createEntityManager();
		}
		return em;
	}
}

